<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	

<div class="sidebar-nav navbar-collapse">
	<ul class="nav" id="side-menu">
		<li class="sidebar-search">
           <!-- <div class="input-group custom-search-form">
                 <input type="text" class="form-control" placeholder="Search..." />
                 <span class="input-group-btn">
                 <button class="btn btn-default" type="button">
                     <i class="fa fa-search"></i>
                 </button>
             </span>
             </div>
               input-group --> 
         </li>
         
         <!-- Menu dinamico -->
       	<c:forEach var="item" items="#{menuListMB.resultList}">
          <li >
	        <c:if test="#{subMenuListMB.isExists(item.menu_id)}">
				<a href="#{item.menu_link}" target="#{item.menu_parent}"> 
					<i class="#{item.menu_classe}"></i> 
					#{item.menu_nome}
				 	<span class="fa arrow"></span>
				 </a>
				 <ul class="nav nav-second-level collapse" >
					<c:forEach var="item2" items="#{subMenuListMB.getSubMenu(item.menu_id)}">
						 <li>
				             <a href="#{item2.smen_link}" target="#{item2.smen_parent}">#{item2.smen_nome}</a>
				         </li>
					</c:forEach>
				</ul>
			</c:if>
			<c:if test="#{!subMenuListMB.isExists(item.menu_id)}">
				<a href="#{item.menu_link}" target="#{item.menu_parent}"> 
					<i class="#{item.menu_classe}"></i> 
					#{item.menu_nome}
				</a>
			</c:if>
		 </li>
        </c:forEach>
	     <!-- /.Menu dinamico -->
  
        <h:form>
		<p:menubar>
			<p:submenu label="#{messages['menu.perfil']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/perfil_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/perfil_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.companyEnd']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/companyEnd_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/companyEnd_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.company']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/company_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/company_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.subMenu']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/submenu_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/submenu_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.users']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/users_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/users_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.log']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/log_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/log_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.menu']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/menu_edit.jsf"></p:menuitem>
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/menu_list.jsf"></p:menuitem>
			</p:submenu>

			<p:submenu label="#{messages['menu.bookmark']}">
				<p:menuitem value="#{messages['menu.menuitem.new']}" url="/bookmark_edit.jsf" />
				<p:menuitem value="#{messages['menu.menuitem.list']}" url="/bookmark_list.jsf" />
			</p:submenu>

			<p:menuitem value="#{messages['menu.menuitem.quit']}" url="http://www.frameworkdemoiselle.gov.br/"
				action="#{securityContext.logout}" />
		</p:menubar>
	</h:form>
	</ul>
</div>
</ui:composition>